﻿using CommunicationClass.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using static CommunicationClass.Model.SendReceiveEnum;
using static CommunicationClass.Server.ServerCommunication;

namespace CommunicationClass.Server.Model
{
    public class TcpServerDelegate
    {
        /// <summary>
        /// 消息日志委托
        /// </summary>
        /// <param name="journalMessageEnum">消息类型</param>
        /// <param name="Message">日志内容</param>
        public delegate void DelegateJournalMessage(JournalMessageEnum journalMessageEnum, string Message);

        /// <summary>
        /// 登录委托
        /// </summary>
        /// <param name="UserID">用户ID</param>
        /// <param name="UserPwd">用户密码</param>
        /// <param name="MsgLoginTypeEnum">登录设备</param>
        /// <param name="UserName">登录后用户用户名</param>
        /// <param name="Message">登录回调详细信息数据</param>
        /// <returns></returns>
        public delegate bool DelegateServerLogin(string UserID, string UserPwd, MsgLoginTypeEnum MsgLoginTypeEnum, out string UserName, out string Message);
        /// <summary>
        /// 接收消息
        /// </summary>
        /// <param name="messageModel">接收消息处理,用于操作数据库</param>
        /// <param name="MessageType">消息类型</param>
        /// <param name="Message">异常信息</param>
        /// <returns></returns>
        public delegate bool DelegateServerReceiveMessage(MessageModel messageModel, SendOrReceiveTypeEnum MessageType, out string Message);
        /// <summary>
        /// 加载登录信息
        /// </summary>
        /// <param name="messageUser">当前用户</param>
        /// <returns>Json数据</returns>
        public delegate string DelegateLoadData(MessageUserLogin messageUser);

    }
}
